<?php
/**
 * Created by PhpStorm.
 * Author: Shadow
 * Date: 2022/8/24
 * Time: 3:19 下午
 * description: api.php
 * 接口路由
 */

use think\facade\Route;

Route::get('/',"index/index");//测试前期准备工作

//通过allowCrossDomain 针对于单个路由支持跨域

Route::post('login','login/login')->allowCrossDomain();//登录接口

Route::get('getCaptcha','login/getCaptcha');// 验证码接口

Route::get('logout','login/logout');//退出登录的接口

Route::post('register','login/register');//注册接口



Route::group(function(){
    Route::resource('goods','goods');

    Route::get('auditing/:id/:is_recommend','goods/auditing');


    # 文件上传的路由
    Route::post("singleUpload",'image/singleUpload');
    Route::post("multiUpload",'image/multiUpload');


    # 品牌的业务逻辑
    Route::resource('brand','brand');
    # 分类
    Route::resource('category','category');

    # 类型 （模型）
    Route::resource('types','type');
})->middleware(\app\adminapi\middleware\Check::class);
